<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // ES5 环境
        function f() { console.log('I am outside!'); }

        (function () {
            function f() { console.log('I am inside!'); }
            if (false) {
            }
            f();
        }());
        // ES6 就完全不一样了，理论上会得到“I am outside!”。因为块级作用域内声明的函数类似于let，对作用域之外没有影响。
    </script>
</body>

</html>